import request from '@/axios'
import { OrgConvertType } from '@/components/WsmTable/src/types'

//获取数据变更时的表详情
export const getApi = (params) => {
  return request.get({
    url: '/logger-server/logger/loggerdbtablelog/get',
    params,
    convert: {
      orgConvert: [
        {
          name: 'orgId',
          type: OrgConvertType.ORG_SHORT_NAME
        }
      ]
    }
  })
}

//获取数据变更时的数据
export const getColumnsApi = (params) => {
  return request.get({
    url: '/logger-server/logger/loggerdbcolumnlog/list',
    params,
    convert: {
      orgConvert: [
        {
          name: 'orgId',
          type: OrgConvertType.ORG_SHORT_NAME
        }
      ],
      dateFormat: [
        {
          name: 'logTime',
          format: 'yyyy-MM-dd HH:mm:ss'
        }
      ]
    }
  })
}

//加载生命周期数据
export const loadLifeCycleApi = (params) => {
  return request.get({
    url: '/logger-server/logger/loggerdbtablelog/list',
    params,
    convert: {
      orgConvert: [
        {
          name: 'orgId',
          type: OrgConvertType.ORG_SHORT_NAME
        }
      ],
      dateFormat: [
        {
          name: 'logTime',
          format: 'yyyy-MM-dd HH:mm:ss'
        }
      ]
    }
  })
}
